 
setwd("~/Dropbox/Job Market Paper/IO Revisions/Replication_Files/Replication_Appendix/A_Table_1")



library(survival); library(coxme)

 load(file="figs_3_4.Rdata")
 
 
 
 
 effs<-ranef(fit.3)$cent
 
 Z<-data.frame(as.matrix(NA,length(effs),length(effs) ))
 
 diffs<-data.frame(as.matrix(NA,length(effs),length(effs) ))
 
 

 
 
 se<-sqrt(fit.3$vcoef$cent+fit.3$vcoef$cent)
 
 for(i in 1:length(effs)){
 	
 	for(j in 1:length(effs)){
 	
 	if(i  <= j ){diffs[j,i]<- effs[j] -effs[i] }
 	
 	if(i  <=j ){Z[j,i]<- (effs[j] -effs[i])/se }
 	
 	}
 	
 }
 

 diffs<-round(diffs,3)
 Z<-round(Z,3)
  
 
 try({
 empty<-data.frame(matrix(NA,2*nrow(Z),ncol(Z)))
 
 di<-seq(1,nrow(empty)-1,by=2)
  zi<-seq(2,nrow(empty),by=2)
 
 for(i in 1:nrow(empty)){
 	
 	
 	empty[di[i],]<-diffs[i,]
 	empty[zi[i],]<-paste("(",Z[i,],")")
 	
 	
 	
 }
 
 
 })
 
 
 empty2<-data.frame(matrix(NA,nrow(empty), ncol(empty)*2 ))
 
 
 for(i in seq(1,ncol(empty2),by=2)){
 
empty2[,i]<-"&"

}
 
 
 cl<-seq(2,ncol(empty2),by=2)
 
   for(i in 1:ncol(empty)){
   	
   	empty2[,cl[i]]<-empty[,i]
   	
   	
   	
   }
 
 
 empty2$X15<-"\\"
 
 
 for(i in 1:ncol(empty2)){
 	
 	empty2[,i]<-ifelse(is.na(empty2[,i]), "\bdot", empty2[,i]  )
 	
 	
 }
 
 
 print(empty2)
 
 
 
 